using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_REFERALSMap : EntityTypeConfiguration<SO_REFERALS>
    {
        public SO_REFERALSMap()
        {
            // Primary Key
            this.HasKey(t => t.FIRST_NAME);

            // Properties
            this.Property(t => t.ID)
                .HasMaxLength(10);

            this.Property(t => t.NAME)
                .HasMaxLength(41);

            this.Property(t => t.Fees_plan)
                .HasMaxLength(50);

            this.Property(t => t.ADDRESS)
                .HasMaxLength(40);

            this.Property(t => t.PHONE)
                .HasMaxLength(19);

            this.Property(t => t.city)
                .HasMaxLength(20);

            this.Property(t => t.LICENSE_NO)
                .HasMaxLength(15);

            this.Property(t => t.SALUTATION)
                .HasMaxLength(15);

            this.Property(t => t.FIRST_NAME)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.LAST_NAME)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("SO_REFERALS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.NAME).HasColumnName("NAME");
            this.Property(t => t.Fees_plan).HasColumnName("Fees_plan");
            this.Property(t => t.BIRTH_DATE).HasColumnName("BIRTH_DATE");
            this.Property(t => t.ADDRESS).HasColumnName("ADDRESS");
            this.Property(t => t.PHONE).HasColumnName("PHONE");
            this.Property(t => t.city).HasColumnName("city");
            this.Property(t => t.LICENSE_NO).HasColumnName("LICENSE_NO");
            this.Property(t => t.SALUTATION).HasColumnName("SALUTATION");
            this.Property(t => t.FIRST_NAME).HasColumnName("FIRST_NAME");
            this.Property(t => t.LAST_NAME).HasColumnName("LAST_NAME");
        }
    }
}
